home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / dist-packages / computerjanitor / package_cruft.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-10-12  |  2.4 KB  |  51 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import computerjanitor
  5. _ = computerjanitor.setup_gettext()
  6.  
  7. class PackageCruft(computerjanitor.Cruft):
  8.     '''Cruft that is .deb packages.
  9.     
  10.     This type of cruft consists of .deb packages installed onto the
  11.     system which can be removed. Various plugins may decide that
  12.     various packages are cruft; they can all use objects of PackageCruft
  13.     type to mark such packages, regardless of the reason the packages
  14.     are considered cruft.
  15.     
  16.     When PackageCruft instantiated, the package is identified by an
  17.     apt.Package object. That object is used for all the real operations,
  18.     so this class is merely a thin wrapper around it.
  19.     
  20.     '''
  21.     
  22.     def __init__(self, pkg, description):
  23.         self._pkg = pkg
  24.         self._description = description
  25.  
  26.     
  27.     def get_prefix(self):
  28.         return 'deb'
  29.  
  30.     
  31.     def get_prefix_description(self):
  32.         return _('.deb package')
  33.  
  34.     
  35.     def get_shortname(self):
  36.         return self._pkg.name
  37.  
  38.     
  39.     def get_description(self):
  40.         return '%s\n\n%s' % (self._description, self._pkg.summary)
  41.  
  42.     
  43.     def get_disk_usage(self):
  44.         return self._pkg.installedSize
  45.  
  46.     
  47.     def cleanup(self):
  48.         self._pkg.markDelete()
  49.  
  50.  
  51.